package com.allen.imsystem.chat.model.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="GroupChat对象", description="用户-群 会话表")
public class GroupChat implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "会话id")
    @TableId(value = "chat_id", type = IdType.NONE)
    private Long chatId;

    @ApiModelProperty(value = "用户uid")
    private String uid;

    @ApiModelProperty(value = "群id")
    private String gid;

    @ApiModelProperty(value = "0->无效，不在群内，1->在群内")
    private Boolean status;

    @ApiModelProperty(value = "未使用")
    private Long lastAckMsgId;

    @ApiModelProperty(value = "用户群昵称")
    private String userAlias;

    @ApiModelProperty(value = "邀请者id")
    private String inviterId;

    @ApiModelProperty(value = "未读消息数")
    private Integer unreadMsgCount;

    @ApiModelProperty(value = "是否显示在会话列表（0->被移除，1->未被移除）")
    private Boolean shouldDisplay;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT)
    private Date updateTime;

    public GroupChat() {
    }

    public GroupChat(Long chatId, String uid, String gid, String userAlias, String inviterId, Boolean shouldDisplay) {
        this.chatId = chatId;
        this.uid = uid;
        this.gid = gid;
        this.userAlias = userAlias;
        this.inviterId = inviterId;
        this.shouldDisplay = shouldDisplay;
    }

    public GroupChat(Long chatId, String uid, String gid, Long lastAckMsgId, String userAlias, String inviterId, Boolean status, Boolean shouldDisplay, Date createdTime, Date updateTime) {
        this.chatId = chatId;
        this.uid = uid;
        this.gid = gid;
        this.lastAckMsgId = lastAckMsgId;
        this.userAlias = userAlias;
        this.inviterId = inviterId;
        this.status = status;
        this.shouldDisplay = shouldDisplay;
        this.createdTime = createdTime;
        this.updateTime = updateTime;
    }


}
